;; ---------------------
;; -- File skeletons  --
;; ---------------------
(define-skeleton latex-skeleton
  "Default LaTeX file initial contents."
  "Title: "
  "\\documentclass[11pt]{article}\n\n"
  "\\input{\$HOME/defaults} %\$\n"
  "\\title{ "str | " ENTER TITLE HERE " "}\n\n"
  "\\begin{document}\n"
  "\\maketitle\n\n"
  ""_"\n\n"
  "\\bibliography{" (skeleton-read "BIB-file: ") | " SPECIFY BIB FILE HERE " "}\n\n"
  "\\end{document}\n")

(define-skeleton hpp-skeleton
  "Default C/C++ header guards."
  nil
  (let* ((name (file-name-nondirectory buffer-file-name))
	 (macro (replace-regexp-in-string
		 "\\." "_"
		 (replace-regexp-in-string
		  "-" "_"
		  (upcase name)))))
    (insert "#ifndef __" macro "__\n")
    (insert "#define __" macro "__\n"))
  \n >
  _
  \n >
  \n >
  (let* ((name (file-name-nondirectory buffer-file-name))
	 (macro (replace-regexp-in-string
		 "\\." "_"
		 (replace-regexp-in-string
		  "-" "_"
		  (upcase name)))))
    (insert "#endif /* __" macro "__ */"))
)




